//
//  UIImage+Ext.swift
//  Swift-sina
//
//  Created by gaoyanyun on 16/5/10.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

extension UIImage{
    //returns: 单点画线
    
    class func cz_singleDotImage(color: UIColor) -> UIImage {
        //开启上下文
        UIGraphicsBeginImageContextWithOptions(CGSize(width: 1, height: 1), false, UIScreen.mainScreen().scale)
        
        //画图填充颜色
        color.setFill()
        UIRectFill(CGRectMake(0, 0, 1, 1))
        
        //从上下文获取图像
        let result = UIGraphicsGetImageFromCurrentImageContext()
        
        //关闭上下文
        UIGraphicsEndImageContext()
        
       //返回图像
        return result
        
        
        
       
    }
}